import os, sys
from io import BytesIO, IOBase
def Accepted():
n = int(input())
m = int(input())
ans=2
for i in range(1,n):
ans<<=1
if ans>m:
print(m)
return
print(m%ans)
BUFSIZE = 8192
class FastIO(IOBase):
newlines = 0
def __init__(self, file):
self._file = file
self._fd = file.fileno()
self.buffer = BytesIO()
self.writable = "x" in file.mode or "r" not in file.mode
self.write = self.buffer.write if self.writable else None
def read(self):
while True:
b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
if not b:
break
ptr = self.buffer.tell()
self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
self.newlines = 0
return self.buffer.read()
def readline(self):
while self.newlines == 0:
b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
self.newlines = b.count(b"\n") + (not b)
ptr = self.buffer.tell()
self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
self.newlines -= 1
return self.buffer.readline()
def flush(self):
if self.writable:
os.write(self._fd, self.buffer.getvalue())
self.buffer.truncate(0), self.buffer.seek(0)
class IOWrapper(IOBase):
def __init__(self, file):
self.buffer = FastIO(file)
self.flush = self.buffer.flush
self.writable = self.buffer.writable
self.write = lambda s: self.buffer.write(s.encode("ascii"))
self.read = lambda: self.buffer.read().decode("ascii")
self.readline = lambda: self.buffer.readline().decode("ascii")
sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")
if __name__ == "__main__":
tc = 1
while tc:
Accepted()
tc -= 1
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
typedef long long ll;
#define go() ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
const int M=1e9+7;
int add(int a,int b)
{
return (a%M+b%M)%M;
}
ll multi(ll a,ll b,ll md)
{
return (a%md*b%md)%md;
}
int power(ll x,ll n)
{
if(n==0) return 1;
ll res=power(x,n/2);
res=res*res;
if(n%2) res=res*x;
return res;
}
int main()
{
go();
ll n,m; cin>>n>>m;
if(n>30) cout<<m;
else cout<<m%power(2,n);
}
1672B - I love AAAB | 1673A - Subtle Substring Subtraction |
1345A - Puzzle Pieces | 711A - Bus to Udayland |
779B - Weird Rounding | 1703D - Double Strings |
1704C - Virus | 63A - Sinking Ship |
1704B - Luke is a Foodie | 298B - Sail |
239A - Two Bags of Potatoes | 1704E - Count Seconds |
682A - Alyona and Numbers | 44A - Indian Summer |
1133C - Balanced Team | 1704A - Two 0-1 Sequences |
1467A - Wizard of Orz | 1714E - Add Modulo 10 |
1714A - Everyone Loves to Sleep | 764A - Taymyr is calling you |
1714B - Remove Prefix | 1264F - Beautiful Fibonacci Problem |
52A - 123-sequence | 1543A - Exciting Bets |
1714D - Color with Occurrences | 215B - Olympic Medal |
1445A - Array Rearrangment | 1351A - A+B (Trial Problem) |
935B - Fafa and the Gates | 1291A - Even But Not Even |